import { Component, OnInit } from '@angular/core';
import { EventManagerService } from 'src/app/services/event-manager.service';
import { OrgCodeItem } from '../models';

@Component({
  selector: 'zepride-separator-code-input',
  templateUrl: './separator-code-input.component.html',
  styleUrls: ['./separator-code-input.component.less']
})
export class SeparatorCodeInputComponent implements OnInit {
  orgItem: OrgCodeItem;
  onAddItemHandle;
  onDelOrgCodeItemHandle;
  constructor(
    private eventSvr: EventManagerService
  ) { }

  ngOnInit(): void {
    console.log(this.orgItem);
  }

  addAutoItem(type) {
    this.onAddItemHandle && this.onAddItemHandle(type);
    this.eventSvr.callEvents('groupBoxResize', { action: 'add' });
  }

  delItem() {
    this.onDelOrgCodeItemHandle && this.onDelOrgCodeItemHandle(this.orgItem);
    this.eventSvr.callEvents('groupBoxResize', { action: 'add' });
  }

}
